package com.devshephard.rpcframework.acm.tree.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PLT {
    public static void main(String[] args) {

        int StepTotalNumber = 3;

        List<StringBuffer> RoadMapList = new ArrayList<>();

        //初始化一个1
        RoadMapList.add(new StringBuffer("1"));

        Integer StartPointer = 0;


        for (int i = 0; i < StepTotalNumber; i++) {

            StartPointer =  (int)(Math.pow(2,i)) - 1;

            for (int k = StartPointer; k < (int)(Math.pow(2,i+1)) - 1 ; k++) {

                 int i1 = Integer.parseInt(RoadMapList.get(k).toString());
                 int i2 = Integer.parseInt(RoadMapList.get(k).toString());

                StringBuffer RoadDrawA = new StringBuffer(String.valueOf(i1));
                StringBuffer RoadDrawB = new StringBuffer(String.valueOf(i2));

                    RoadDrawA.append("1");
                    RoadMapList.add(RoadDrawA);
                    RoadDrawB.append("2");
                    RoadMapList.add(RoadDrawB);

               }

                StartPointer ++;

            }

        System.out.println(RoadMapList.toString());

      }
    }
